<?php
@session_start ();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../u_css/index.css" />
<title>主页</title>
</head>
<body>
<?php
include '../include_htmls/header.php';
?>

<div id="body">
<div id="search">
<form action="searchResult.php" method="get">
<div>
<?php
require '../mysql_connection/for_u_lijinsheng.php';
$good_type = get_Good_Types ();
?>
<label>产品类型：<select name="goodType" id="goods_type">
<?php
for($i = 0; $i < count ( $good_type ); $i ++) {
	?>
<option value=<?=$good_type [$i] [0]?>> <?=$good_type [$i] [2]?> </option>
<?php
}
?>
</select> </label> <label>最低价格:<input type="text" name="lowestPrice"
	id="lowest_price" /></label> <label>最高价格:<input type="text"
	name="highestPrice" id="highest_price" /></label> <label>年:<input
	type="text" name="year" id="year" /></label> <label>月:<input
	type="text" name="month" id="month" /></label> <label>日:<input
	type="text" name="day" id="day" /></label> <input type="submit"
	value="搜索" id="submit_button" /></div>
</form>
</div>

<div id="popularGoods">
<h1>最受欢迎的商品</h1>
<hr />
<?php
foreach ( get_Popular_Goods () as $good ) {
	?>
<div class="goodsContainer"><a
	href="http://localhost/e-commerce/user_php/goods_detail.php?id=<?=$good [0]?>">
<img src="<?=$good [10]?>"></img> <br />产品名称：<?=$good [1]?>
	</a>
<p class="good_price">产品价格：$<?=$good [2]?></p>
</div>
<?php
}
?>
</div>

<div id="newGoods">
<h1>最新商品</h1>
<hr />
<?php
foreach ( get_New_Goods () as $good ) {
	?>
<div class="goodsContainer"><a
	href="http://localhost/e-commerce/user_php/goods_detail.php?id=<?=$good [0]?>"> <img
	src="<?=$good [10]?>"></img> <br />产品名称：<?=$good [1]?>
	</a>
<p class="good_price">产品价格：$<?=$good [2]?></p>
</div>
<?php
}
?>
</div>
</div>
<?php
include '../include_htmls/footer.html';
?>
</body>
</html>